import 'package:flutter/material.dart';

class MyNavBar extends StatelessWidget {
  MyNavBar({super.key});

  final List navList = [
    {
      'title': '我的房屋',
      'icon': 'assets/images/house_nav_icon@2x.png',
    },
    {
      'title': '我的报修',
      'icon': 'assets/images/repair_nav_icon@2x.png',
    },
    {
      'title': '访客登记',
      'icon': 'assets/images/visitor_nav_icon@2x.png',
    }
  ]; // List

  @override
  Widget build(BuildContext context) => Container(
        decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.circular(12),
        ),
        margin: const EdgeInsets.only(top: 12, bottom: 12),
        padding: const EdgeInsets.only(top: 10, bottom: 10),
        width: double.infinity,
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: navList
              .map((navT) => Column(
                    children: [
                      Image.asset(
                        navT['icon'],
                        width: 40,
                        height: 40,
                      ),
                      const SizedBox(height: 5),
                      Text(
                        navT['title'],
                        style: const TextStyle(color: Color(0xff999999)),
                      )
                    ],
                  ))
              .toList(),
        ),
      );
}
